/**
 * 
 */
package com.thinkgsp.sys.service.impl;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.thinkgsp.sys.model.SysResource;
import com.thinkgsp.sys.persistence.SysResourceMapper;
import com.thinkgsp.sys.service.SysResourceService;

/**
 * @author evan
 *
 */
@Service("sysResourceService")
public class SysResourceServiceImpl extends BaseServiceImpl implements
		SysResourceService {

	@Autowired
	private SysResourceMapper sysResourceMapper;
	/* (non-Javadoc)
	 * @see com.thinkgsp.sys.service.SysResourceService#getAllResource()
	 */
	public List<SysResource> getAllResource() {
		return sysResourceMapper.getAllResource();
	}

	/* (non-Javadoc)
	 * @see com.thinkgsp.sys.service.SysResourceService#getAllRootResource()
	 */
	public List<SysResource> getAllRootResource() {
		return sysResourceMapper.getAllRootResource();
	}

	/* (non-Javadoc)
	 * @see com.thinkgsp.sys.service.SysResourceService#getChildResource(int)
	 */
	public List<SysResource> getChildResource(int parentid) {
		return sysResourceMapper.getChildResource(parentid);
	}

	/* (non-Javadoc)
	 * @see com.thinkgsp.sys.service.SysResourceService#getAllChildResource()
	 */
	public List<SysResource> getAllChildResource() {
		return sysResourceMapper.getAllChildResource();
	}

	/* (non-Javadoc)
	 * @see com.thinkgsp.sys.service.SysResourceService#getUserResource(java.lang.Integer, java.lang.Integer)
	 */
	public List<SysResource> getUserResource(@Param("userId") Integer userId,
			@Param("parentId") Integer parentId) {
		return sysResourceMapper.getUserResource(userId, parentId);
	}

}
